package com.songdehuai.imageselect;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.luck.picture.lib.entity.LocalMedia;
import com.songdehuai.imageselect.picture.MyPictureSelector;
import com.songdehuai.imageselect.picture.PictureSelectorCallBack;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    ImageView image_1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        image_1 = findViewById(R.id.image_1);

        image_1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MyPictureSelector.getInstance()
                        .startPictureSelector(MainActivity.this, 9, false)
                        .setCallBack(new PictureSelectorCallBack() {
                            @Override
                            public void onSuccess(List<LocalMedia> localMediaList) {
                                for (int i = 0; i < localMediaList.size(); i++) {
                                    Log.i("图片地址", localMediaList.get(i).getPath() + "\n");
                                }
                            }
                        });
            }
        });
    }

}
